// import request from '@/utils/request'
const users = require('../../../mock/data-source/user.js')
const tokens = require('../../../mock/data-source/token.js')

export function login(data) {
  return new Promise((resolve) => {
    resolve({
      code: '0',
      data: tokens[data.username]
    })
  })
}

export function getInfo(token = 'develop-token') {
  return new Promise((resolve) => {
    resolve({
      code: '0',
      data: users[token]
    })
  })
}

export function logout() {
  return new Promise((resolve) => {
    resolve({
      code: '0',
      data: {}
    })
  })
}
